using AdminBlazor.Test.Components.Blog;
using FreeSql;
using LinCms.Entities.Blog;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace AdminBlazor.Test.Pages
{
    public class IndexModel : PageModel
    {
        private readonly IAggregateRootRepository<Article> articleRepository;
        public IndexModel(IAggregateRootRepository<Article> _articleRepository) {
            articleRepository = _articleRepository;
        }

        public List<Article> Articles { get; set; }

        public async void OnGetAsync()
        {
            Articles = await articleRepository.Select.ToListAsync();
        }
    }
}
